home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / lib / partman / active_partition / 80resize / choices next >
Encoding:
Text File  |  2009-04-19  |  823 b   |  50 lines

  1. #!/bin/sh
  2.  
  3. . /lib/partman/lib/base.sh
  4.  
  5. dev=$1
  6. id=$2
  7. cd $dev
  8.  
  9. open_dialog GET_LABEL_TYPE
  10. read_line label
  11. close_dialog
  12.  
  13. # Disable on devices where there is no "real" partitioning
  14. if [ "$label" = loop ]; then
  15.     exit 0
  16. fi
  17.  
  18. if [ -f $id/detected_filesystem ]; then
  19.     fs=$(cat $id/detected_filesystem)
  20.     case "$fs" in
  21.         linux-swap|fat16|fat32|hfs|hfs+|hfsx)
  22.         ;;
  23.         ext2|ext3|ext4)
  24.         if ! search-path tune2fs || ! search-path resize2fs; then
  25.             exit 0
  26.         fi
  27.         ;;
  28.         ntfs)
  29.         if ! search-path ntfsresize; then
  30.             exit 0
  31.         fi
  32.         ;;
  33.         *)
  34.         exit 0
  35.         ;;
  36.     esac
  37. else
  38.     exit 0
  39. fi
  40.  
  41. open_dialog PARTITION_INFO $id
  42. read_line x1 id size x4 x5 x6 x7 x8
  43. close_dialog
  44.  
  45. hsize=$(longint2human $size)
  46.  
  47. db_subst partman-partitioning/text/resize SIZE "$hsize"
  48. db_metaget partman-partitioning/text/resize description
  49. printf "resize\t%s\n" "${RET}"
  50.